﻿using LinqToLfsWorld.Interface;
using System;
using LinqToLfsWorld.Attributes;
using System.Xml.Serialization;
using System.Runtime.Serialization;

namespace LinqToLfsWorld
{
	/// <summary>
	/// A world record entity
	/// </summary>
	[Serializable]
	[DataContract]
	public class WorldRecord : ILfsWorldEntity
	{

		/// <summary>
		/// Gets or sets the car. This property is queryable
		/// </summary>
		[PubstatQueryable(false)]
		[DataMember]
		public string Car { get; set; }

		/// <summary>
		/// Gets or sets the 3-digit track identifier. This property is queryable.
		/// </summary>
		[PubstatQueryable(false)]
		[DataMember]
		public string TrackIdent { get; set; }

		/// <summary>
		/// Gets the full track name from the <see cref="TrackIdent"/>.
		/// </summary>
		[DataMember]
		public string TrackName { get; set; }

		/// <summary>
		/// Gets or sets the id.
		/// </summary>
		/// <value>The id.</value>
		[DataMember]
		public int Id { get; set; }

		/// <summary>
		/// Gets or sets the first split time.
		/// </summary>
		/// <value>The split1.</value>
		[DataMember]
		public TimeSpan Split1 { get; set; }

		/// <summary>
		/// Gets or sets the second split time.
		/// </summary>
		/// <value>The split2.</value>
		[DataMember]
		public TimeSpan Split2 { get; set; }

		/// <summary>
		/// Gets or sets the third split time.
		/// </summary>
		/// <value>The split3.</value>
		[DataMember]
		public TimeSpan Split3 { get; set; }

		/// <summary>
		/// Gets or sets the lap time.
		/// </summary>
		/// <value>The lap time.</value>
		[DataMember]
		public TimeSpan LapTime { get; set; }

		/// <summary>
		/// Gets or sets the name of the racer.
		/// </summary>
		/// <value>The name of the racer.</value>
		[DataMember]
		public string RacerName { get; set; }

		/// <summary>
		/// Gets or sets the hotlap flags.
		/// </summary>
		/// <value>The flags.</value>
		[DataMember]
		public HotlapFlags Flags { get; set; }
	}
}
